<div class="kt-modal-content">
    <div class="modal-header">
        <button type="button" class="close" ng-click="$dismiss()" aria-label="Close">
            <em class="ion-ios-close-empty sn-link-close"></em>
        </button>
        <h4 class="modal-title">{{kt.title}}</h4>
    </div>
    <div class="modal-body">
        <div ba-panel ba-panel-class="with-scroll light-text">
            <form name="Form" ng-submit="kt.save()">
                <div class="form-group col-md-6 col-sm-6 col-xs-6">
                    <label for="name">设备控制名称</label>
                    <input ng-disabled="kt.isView" type="text" class="form-control" id="name" placeholder="名称"
                           ng-model="kt.devctrl.name" required>
                </div>
                <div class="form-group col-md-6 col-sm-6 col-xs-6">
                    <label for="devUid">所属设备</label>
                    <select ng-disabled="kt.isView" class="form-control" ng-model="kt.devctrl.deviceUid" id="devUid"
                            title="所属设备" data-container="body" selectpicker required
                            ng-options="item.value as item.label for item in kt.devList">
                    </select>
                </div>

                <div class="col-sm-12 hr-line-dashed"></div>

                <div class="form-group col-md-6 col-sm-6 col-xs-6">
                    <label for="sw1Flag">是否启用开关控制</label>
                    <select ng-disabled="kt.isView" class="form-control" ng-model="kt.devctrl.sw1Flag" id="sw1Flag"
                            title="启用状态" data-container="body" selectpicker required
                            ng-options="item.value as item.label for item in kt.devstatus">
                    </select>
                </div>

                <div class="form-group col-md-6 col-sm-6 col-xs-6" ng-if="kt.devctrl.sw1Flag == '1'">
                    <label for="sw1Open">开关打开指令</label>
                    <input ng-disabled="kt.isView" type="text" class="form-control" id="sw1Open" required ng-model="kt.devctrl.sw1InsOpen">
                </div>
                <div class="form-group col-md-6 col-sm-6 col-xs-6"  ng-if="kt.devctrl.sw1Flag == '1'">
                    <label for="sw1Close">开关关闭指令</label>
                    <input ng-disabled="kt.isView" type="text" class="form-control" id="sw1Close" required ng-model="kt.devctrl.sw1InsClose">
                </div>

                <div class="form-group col-md-6 col-sm-6 col-xs-6"  ng-if="kt.devctrl.sw1Flag == '1'">
                    <label for="sw1Chn">开关通道号</label>
                    <input ng-disabled="kt.isView" type="text" class="form-control" id="sw1Chn" required ng-model="kt.devctrl.sw1ChnNum">
                </div>

                <div class="col-sm-12 hr-line-dashed"></div>
                <div class="form-group col-md-6 col-sm-6 col-xs-6">
                    <label for="rebootFlag">是否启用设备重启控制</label>
                    <select ng-disabled="kt.isView" class="form-control" ng-model="kt.devctrl.rebootFlag" id="rebootFlag"
                            title="启用状态" data-container="body" selectpicker required
                            ng-options="item.value as item.label for item in kt.devstatus">
                    </select>
                </div>

                <div class="form-group col-md-6 col-sm-6 col-xs-6" ng-if="kt.devctrl.rebootFlag == '1'">
                    <label for="rebootIns">设备重启指令</label>
                    <input ng-disabled="kt.isView" type="text" class="form-control" id="rebootIns" required
                           ng-model="kt.devctrl.rebootIns">
                </div>

                <div class="col-sm-12 hr-line-dashed"></div>
                <div class="form-group col-md-6 col-sm-6 col-xs-6">
                    <label for="shutdownFlag">是否启用设备关机控制</label>
                    <select ng-disabled="kt.isView" class="form-control" ng-model="kt.devctrl.shutdownFlag" id="shutdownFlag"
                            title="启用状态" data-container="body" selectpicker required
                            ng-options="item.value as item.label for item in kt.devstatus">
                    </select>
                </div>

                <div class="form-group col-md-6 col-sm-6 col-xs-6" ng-if="kt.devctrl.shutdownFlag == '1'">
                    <label for="shutdownIns">设备关机指令</label>
                    <input ng-disabled="kt.isView" type="text" class="form-control" id="shutdownIns" required
                           ng-model="kt.devctrl.shutdownIns">
                </div>

                <div class="col-sm-12 hr-line-dashed"></div>

                <div class="form-group col-md-12 col-sm-12 col-xs-12">
                    <button type="submit" class="btn btn-danger btn-with-icon" ng-if="!kt.isView">
                        <i class="ion-heart"></i>保存
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>